#ifndef GLX_VIDEO_OUTPUT_H
#define GLX_VIDEO_OUTPUT_H

#include <X11/Xlib.h>
#include <unistd.h>
#include <GLee.h>
#include <GL/glx.h>

#include "videooutput.h"
#include "xdnd.h"

class GlxVideoOutput
    : public VideoOutput
{
public:
    GlxVideoOutput();
    virtual ~GlxVideoOutput();
    
    void initialize(int width, int height, bool fullScreen);
    void setWindowTitle(const std::string& title);
    void setFullScreen(bool enabled);
    void toggleVSync();
    void swapBuffers();
    bool hasClosed();
    bool checkResizeEvent(ResizeEvent& event);
    bool checkFiledropEvent(FiledropEvent& event);
    bool checkKeyEvent(KeyEvent& event);
    void setWindowDecorations(bool enabled);
    void alwaysOnTop();
    
private:
    void checkCientMessages();
            
    Display*     m_pDisplay;
    GLXContext   m_GlxContext;
    Window       m_Window;
    GLXWindow    m_GlxWindow;
    Dnd          m_DragNDrop;
    bool         m_HasClosed;

};

#endif
